from django.test import TestCase

# Create your tests here.


from myblogs.utils.send_email import send_email_by_template,send_html_email


def test1(request):
    """发送邮件测试"""
    # 其他逻辑代码就省略了

    # 邮件主题
    subject = u'[杨仕航的博客]博文评论'
    # 模版需要的数据
    email_data = {'comment_name': '测试', 'comment_content': '评论内容', }
    # 模版文件的位置
    template = 'email/comments.html'
    # 收件人列表
    to_list = ['1365682653@qq.com', ]

    # 根据模版发送邮件
    send_email_by_template(subject, template, email_data, to_list)


def hello(request):
    test1(request)